﻿using System;
using System.Drawing;

namespace YRevitJig
{
	public class XCircle2D : XDrawable2D, ICloneable
	{
		public XCircle2D(System.Drawing.Point ptCenter, int iRadius)
		{
			this.PointCenter = ptCenter;
			this.Radius = iRadius;
		}

		public override void Draw(XGraphics g)
		{
			try
			{
				Point point = new System.Drawing.Point(this.PointCenter.X - this.Radius, this.PointCenter.Y - this.Radius);
				RectangleF rect = new RectangleF((float)(this.PointCenter.X - this.Radius), (float)(this.PointCenter.Y - this.Radius), (float)(2 * this.Radius), (float)(2 * this.Radius));
				g.m_graphics.DrawArc(g.m_pen, rect, 0f, 360f);
			}
			catch
			{
			}
		}

		public object Clone()
		{
			try
			{
				return new XCircle2D(this.PointCenter, this.Radius);
			}
			catch
			{
			}
			return null;
		}

		public Point PointCenter { get; set; }

		public int Radius { get; set; }
	}
}
